<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            height: 200px;
            width: 200px;
            background-color: aqua;
        }
    </style>
</head>
<body>
    <div class="box" onmouseenter="changeBox()" onmouseleave="changeBox2()">
        
    </div>
    <script>
        const box = document.querySelector('.box')

        function changeBox() {
            box.style.backgroundColor="gray";
            box.style.marginLeft = '20px';
        }

        function changeBox2() {
            box.style.backgroundColor="aqua";
            box.style.marginLeft = '0';
        }
    </script>
</body>
</html>